Rules for integrands of the form(((a+b (x^n)+c (x^(2 n))))^p)

1:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when  n<0 ∧ p∈ℤ

Derivation: Algebraic expansion

Basis: If  p∈ℤ, then (((a+b (x^n)+c (x^(2 n))))^p)==(x^(2 n p)) (((c+b (x^(-n))+a (x^(-2 n))))^p)

Rule 1.2.3.1.1: If  n<0 ∧ p∈ℤ, then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ∫(x^(2 n p)) (((c+b (x^(-n))+a (x^(-2 n))))^p)dx

Program code:

Int[(a_+b_.*x_^n_+c_.*x_^n2_.)^p_.,x_Symbol] :=
  Int[x^(2*n*p)*(c+b*x^(-n)+a*x^(-2*n))^p,x] /;
FreeQ[{a,b,c},x] && EqQ[n2,2*n] && LtQ[n,0] && IntegerQ[p]

2:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when  n∈𝔽

Derivation: Integration by substitution

Basis: If  k∈(SuperPlus[ℤ]), then F[(x^n)]==k Subst[(x^(k-1))F[(x^(k n))],x,(x^(1/k))] (∂_x)(x^(1/k))

Rule 1.2.3.1.2: If  (b^2)-4 a c≠0∧ n∈𝔽, let k=Denominator[n], then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  k Subst[∫(x^(k-1))(((a+b (x^(k n))+c (x^(2 k n))))^p)dx,x,(x^(1/k))]

Program code:

Int[(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  With[{k=Denominator[n]},
  k*Subst[Int[x^(k-1)*(a+b*x^(k*n)+c*x^(2*k*n))^p,x],x,x^(1/k)]] /;
FreeQ[{a,b,c,p},x] && EqQ[n2,2*n] && FractionQ[n]

3:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when  n∈(SuperMinus[ℤ])

Derivation: Integration by substitution

Basis: If  n∈ℤ, then F[(x^n)]==-Subst[((F[(x^(-n))])/(x^2)),x,(1/x)] (∂_x)(1/x)

Rule 1.2.3.1.3: If  n∈(SuperMinus[ℤ]), then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  -Subst[∫((((a+b (x^(-n))+c (x^(-2 n))))^p)/(x^2))dx,x,(1/x)]

Program code:

Int[(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  -Subst[Int[(a+b*x^(-n)+c*x^(-2*n))^p/x^2,x],x,1/x] /;
FreeQ[{a,b,c,p},x] && EqQ[n2,2*n] && ILtQ[n,0]

4:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c==0

Derivation: Piecewise constant extraction

Basis: If  (b^2)-4 a c==0, then (∂_x)((((a+b (x^n)+c (x^(2 n))))^p)/(((b+2 c (x^n)))^(2 p)))==0

Note: If  (b^2)-4 a c==0, then a+b z+c (z^2)==(1/(4 c)) (((b+2 c z))^2)

Rule 1.2.3.1.4: If  (b^2)-4 a c==0, then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ((((a+b (x^n)+c (x^(2 n))))^p)/(((b+2 c (x^n)))^(2 p)))∫(((b+2 c (x^n)))^(2 p))dx

Program code:

Int[(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_,x_Symbol] :=
  (a+b*x^n+c*x^(2*n))^p/(b+2*c*x^n)^(2*p)*Int[(b+2*c*x^n)^(2*p),x] /;
FreeQ[{a,b,c,n,p},x] && EqQ[n2,2*n] && EqQ[b^2-4*a*c,0]

5.  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ p∈ℤ

1:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ p∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule 1.2.3.1.5.1: If  (b^2)-4 a c≠0 ∧ p∈(SuperPlus[ℤ]), then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ∫ExpandIntegrand[(((a+b (x^n)+c (x^(2n))))^p),x]dx

Program code:

Int[(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  Int[ExpandIntegrand[(a+b*x^n+c*x^(2*n))^p,x],x] /;
FreeQ[{a,b,c,n},x] && EqQ[n2,2*n] && NeQ[b^2-4*a*c,0] && IGtQ[p,0]

2:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4a c≠0 ∧ p+1∈(SuperMinus[ℤ])

Reference: G&R 2.161.5

Derivation: Trinomial recurrence 2b with m=0, A=1 and B=0

Note: G&R 2.161.4 is a special case of G&R 2.161.5.

Rule 1.2.3.1.5.2: If  (b^2)-4a c≠0 ∧ p+1∈(SuperMinus[ℤ]), then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  
-((x ((b^2)-2 a c+b c (x^n))(((a+b (x^n)+c (x^(2 n))))^(p+1)))/(a n (p+1) ((b^2)-4 a c)))+
(1/(a n(p+1) ((b^2)-4 a c)))∫((b^2)-2 a c+n(p+1) ((b^2)-4 a c)+b c(n (2 p+3)+1)(x^n)) (((a+b (x^n)+c (x^(2 n))))^(p+1))dx

Program code:

Int[(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  -x*(b^2-2*a*c+b*c*x^n)*(a+b*x^n+c*x^(2*n))^(p+1)/(a*n*(p+1)*(b^2-4*a*c)) +
  1/(a*n*(p+1)*(b^2-4*a*c))*
    Int[(b^2-2*a*c+n*(p+1)*(b^2-4*a*c)+b*c*(n*(2*p+3)+1)*x^n)*(a+b*x^n+c*x^(2*n))^(p+1),x] /;
FreeQ[{a,b,c,n},x] && EqQ[n2,2*n] && NeQ[b^2-4*a*c,0] && ILtQ[p,-1]

3.  ∫(1/(a+b (x^n)+c (x^(2n))))dx  when (b^2)-4 a c≠0

1:  ∫(1/(a+b (x^n)+c (x^(2 n))))dx  when (b^2)-4 a c≠0 ∧ (n/2)∈(SuperPlus[ℤ])∧ (b^2)-4 a c≯0

Derivation: Algebraic expansion

Basis: If  q->(Sqrt[(a/c)]) and r->(Sqrt[2 q-(b/c)]), then (1/(a+b (z^2)+c (z^4)))==((r-z)/(2 c q r (q-r z+(z^2))))+((r+z)/(2 c q r (q+r z+(z^2))))

Note: If (a|b|c)∈ℝ ∧ (b^2)-4 a c<0, then (a/c)>0 and 2 (Sqrt[(a/c)])-(b/c)>0.

Rule 1.2.3.1.5.3.1: If  (b^2)-4 a c≠0 ∧ (n/2)∈(SuperPlus[ℤ])∧ (b^2)-4 a c≯0, let q->(Sqrt[(a/c)]) and r->(Sqrt[2 q-(b/c)]), then

∫(1/(a+b (x^n)+c (x^(2 n))))dx  ⟶  (1/(2 c q r))∫((r-(x^(n/2)))/(q-r (x^(n/2))+(x^n)))dx+(1/(2 c q r))∫((r+(x^(n/2)))/(q+r (x^(n/2))+(x^n)))dx

Program code:

Int[1/(a_+b_.*x_^n_+c_.*x_^n2_),x_Symbol] :=
  With[{q=Rt[a/c,2]},
  With[{r=Rt[2*q-b/c,2]},
  1/(2*c*q*r)*Int[(r-x^(n/2))/(q-r*x^(n/2)+x^n),x] + 
  1/(2*c*q*r)*Int[(r+x^(n/2))/(q+r*x^(n/2)+x^n),x]]] /;
FreeQ[{a,b,c},x] && EqQ[n2,2*n] && NeQ[b^2-4*a*c,0] && IGtQ[n/2,0] && NegQ[b^2-4*a*c]

2:  ∫(1/(a+b (x^n)+c (x^(2n))))dx  when (b^2)-4 a c≠0 ∧ ((n/2)∉(SuperPlus[ℤ])∨ (b^2)-4 a c>0)

Reference: G&R 2.161.1a

Derivation: Algebraic expansion

Basis: Let q->(Sqrt[(b^2)-4 a c]), then (1/(a+b z+c (z^2)))==(c/q)(1/((b/2)-(q/2)+c z))-(c/q)(1/((b/2)+(q/2)+c z))

Rule 1.2.3.1.5.3.2: If  (b^2)-4 a c≠0, let q->(Sqrt[(b^2)-4 a c]), then

∫(1/(a+b (x^n)+c (x^(2n))))dx  ⟶  (c/q)∫(1/((b/2)-(q/2)+c (x^n)))dx-(c/q)∫(1/((b/2)+(q/2)+c (x^n)))dx

Program code:

Int[1/(a_+b_.*x_^n_+c_.*x_^n2_),x_Symbol] :=
  With[{q=Rt[b^2-4*a*c,2]},
  c/q*Int[1/(b/2-q/2+c*x^n),x] - c/q*Int[1/(b/2+q/2+c*x^n),x]] /;
FreeQ[{a,b,c},x] && EqQ[n2,2*n] && NeQ[b^2-4*a*c,0]

6:  ∫(((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)(( (((a+b (x^n)+c (x^(2 n))))^p))/((((1+((2 c (x^n))/(b+(Sqrt[(b^2)-4 a c])))))^p) (((1+((2 c (x^n))/(b-(Sqrt[(b^2)-4 a c])))))^p)))==0

Rule 1.2.3.1.6: If  (b^2)-4 a c≠0 ∧ p∉ℤ, then

∫(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (( (a^(IntPart[p])) (((a+b (x^n)+c (x^(2 n))))^(FracPart[p])))/((((1+((2 c (x^n))/(b+(Sqrt[(b^2)-4 a c])))))^(FracPart[p])) (((1+((2 c (x^n))/(b-(Sqrt[(b^2)-4 a c])))))^(FracPart[p])))) ∫(((1+((2 c (x^n))/(b+(Sqrt[(b^2)-4 a c])))))^p) (((1+((2 c (x^n))/(b-(Sqrt[(b^2)-4 a c])))))^p)dx

Program code:

Int[(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  a^IntPart[p]*(a+b*x^n+c*x^(2*n))^FracPart[p]/
    ((1+2*c*x^n/(b+Rt[b^2-4*a*c,2]))^FracPart[p]*(1+2*c*x^n/(b-Rt[b^2-4*a*c,2]))^FracPart[p])*
    Int[(1+2*c*x^n/(b+Sqrt[b^2-4*a*c]))^p*(1+2*c*x^n/(b-Sqrt[b^2-4*a*c]))^p,x] /;
FreeQ[{a,b,c,n,p},x] && EqQ[n2,2*n] && NeQ[b^2-4*a*c,0] && Not[IntegerQ[p]]

S:  ∫(((a+b (u^n)+c (u^(2 n))))^p)dx  when  u==d+e x

Derivation: Integration by substitution

Rule 1.2.3.1.S: If  u==d+e x, then

∫(((a+b (u^n)+c (u^(2 n))))^p)dx  ⟶  (1/e)Subst[∫(((a+b (x^n)+c (x^(2 n))))^p)dx,x,u]

Program code:

Int[(a_+b_.*u_^n_+c_.*u_^n2_.)^p_,x_Symbol] :=
  1/Coefficient[u,x,1]*Subst[Int[(a+b*x^n+c*x^(2*n))^p,x],x,u] /;
FreeQ[{a,b,c,n,p},x] && EqQ[n2,2*n] && LinearQ[u,x] && NeQ[u,x]

9.  ∫(((a+b (x^(-n))+c (x^n)))^p)dx

1:  ∫(((a+b (x^(-n))+c (x^n)))^p)dx  when  p∈ℤ

Derivation: Algebraic normalization

Basis: a+b (x^(-n))+c (x^n)==((b+a (x^n)+c (x^(2 n)))/(x^n))

Rule 1.2.3.1.9.1: If  p∈ℤ, then

∫(((a+b (x^(-n))+c (x^n)))^p)dx  ⟶  ∫((((b+a (x^n)+c (x^(2 n))))^p)/(x^(n p)))dx

Program code:

Int[(a_+b_.*x_^mn_+c_.*x_^n_.)^p_.,x_Symbol] :=
  Int[(b+a*x^n+c*x^(2*n))^p/x^(n*p),x] /;
FreeQ[{a,b,c,n},x] && EqQ[mn,-n] && IntegerQ[p] && PosQ[n]

2:  ∫(((a+b (x^(-n))+c (x^n)))^p)dx  when  p∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)(((x^(n p)) (((a+b (x^(-n))+c (x^n)))^p))/(((b+a (x^n)+c (x^(2 n))))^p))==0

Basis: (((x^(n p)) (((a+b (x^(-n))+c (x^n)))^p))/(((b+a (x^n)+c (x^(2 n))))^p))==(((x^(n FracPart[p])) (((a+b (x^(-n))+c (x^n)))^(FracPart[p])))/(((b+a (x^n)+c (x^(2 n))))^(FracPart[p])))

Rule 1.2.3.1.9.2: If  p∉ℤ, then

∫(((a+b (x^(-n))+c (x^n)))^p)dx  ⟶  (((x^(n FracPart[p])) (((a+b (x^(-n))+c (x^n)))^(FracPart[p])))/(((b+a (x^n)+c (x^(2 n))))^(FracPart[p])))∫((((b+a (x^n)+c (x^(2 n))))^p)/(x^(n p)))dx

Program code:

Int[(a_+b_.*x_^mn_+c_.*x_^n_.)^p_,x_Symbol] :=
  x^(n*FracPart[p])*(a+b*x^(-n)+c*x^n)^FracPart[p]/(b+a*x^n+c*x^(2*n))^FracPart[p]*Int[(b+a*x^n+c*x^(2*n))^p/x^(n*p),x] /;
FreeQ[{a,b,c,n,p},x] && EqQ[mn,-n] && Not[IntegerQ[p]] && PosQ[n]